-
Notifications
You must be signed in to change notification settings - Fork 598
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor(connector): Add a dummy trait WithOptions
#14175
refactor(connector): Add a dummy trait WithOptions
#14175
Conversation
Current dependencies on/for this PR:
This stack of pull requests is managed by Graphite. |
cbda545
to
a4945e4
Compare
5106232
to
1a654b3
Compare
/// Marker trait for `WITH` options. Only for `#[derive(WithOptions)]`, should not be used manually. | ||
/// | ||
/// This is used to ensure the `WITH` options types have reasonable structure. | ||
/// | ||
/// TODO: add this bound for sink. There's a `SourceProperties` trait for sources, but no similar | ||
/// things for sinks. | ||
pub trait WithOptions { | ||
#[doc(hidden)] | ||
#[inline(always)] | ||
fn assert_receiver_is_with_options(&self) {} | ||
} | ||
|
||
// Currently CDC properties are handled specially. | ||
// - It simply passes HashMap to Java DBZ. | ||
// - It's not handled by serde. | ||
// - It contains fields other than WITH options. | ||
// TODO: remove the workaround here. And also use #[derive] for it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Highlight TODOs
/// | ||
/// Note: here we assumes the struct is parsed by `serde`. If it's not the case, | ||
/// the generated `yaml` might be inconsistent with the actual parsing logic. | ||
/// TODO: improve the test to check whether serde is used. | ||
/// | ||
/// - For sources, the parsing logic is in `TryFromHashMap`. | ||
/// - For sinks, the parsing logic is in `TryFrom<SinkParam>`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Highlight Note
c3cc640
to
94bc3a2
Compare
d6e8b64
to
1ff6db4
Compare
307f0da
to
5bb84dd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
COOL
71d2b0f
to
ecba13b
Compare
9af8ff0
to
da8f4e4
Compare
ecba13b
to
e44b49f
Compare
da8f4e4
to
6173db2
Compare
6173db2
to
e2f5a96
Compare
I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.
What's changed and what's your intention?
To enforce children types are also marked with
WithOptions
.As proposed by Bugen here #13654 (comment)
Checklist
./risedev check
(or alias,./risedev c
)Documentation
Release note
If this PR includes changes that directly affect users or other significant modifications relevant to the community, kindly draft a release note to provide a concise summary of these changes. Please prioritize highlighting the impact these changes will have on users.